package com.sys.utils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import com.sys.utils.RequestUtil;
public class CommonInterceptor extends HandlerInterceptorAdapter{
	private final Logger log = LoggerFactory.getLogger(CommonInterceptor.class);
	    @Override  
    public boolean preHandle(HttpServletRequest request,  
            HttpServletResponse response, Object handler) throws Exception {  
    	if ("GET".equalsIgnoreCase(request.getMethod())) {
    		RequestUtil.saveRequest();
        }
    	        String servletPath	= request.getServletPath();
        String bRet			= "FALSE";
                if(servletPath.startsWith("/Login"))
        	bRet = "TRUE";
		        return true;
		    }  
      @Override  
    public void postHandle(HttpServletRequest request,  
            HttpServletResponse response, Object handler,  
            ModelAndView modelAndView) throws Exception {   
    }  
      @Override  
    public void afterCompletion(HttpServletRequest request,  
            HttpServletResponse response, Object handler, Exception ex)  
            throws Exception {  
    }  
}  
